package com.bizihang.validate.core.spring;

import com.bizihang.validate.core.spring.endpoint.FrameworkEndpoint;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FrameworkEndpoint
@RequestMapping(value = "/code")
public class ValidateCodeEndpoint {
    @RequestMapping(value = "/{type}", method = {RequestMethod.GET})
    public ResponseEntity createCode(@PathVariable() String type, HttpServletRequest request) {
        //创建
        //存储
        //发送
        HttpHeaders headers = new HttpHeaders();
        headers.set("Cache-Control", "no-store");
        headers.set("Pragma", "no-cache");
        headers.set("Content-Type", "application/json;charset=UTF-8");
        return new ResponseEntity<List<String>>(null, headers, HttpStatus.OK);
    }
}
